package com.zx.fm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zx.common.annotation.Excel;
import com.zx.common.core.domain.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * -- 高贵的马儿驱逐体内的一切外力 --
 *
 * @author kaajee
 * @date 2025/9/6
 * @desc
 */
@Setter
@Getter
public class GoodsLoan extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 借货编号 */
    @Excel(name = "借货编号")
    private String loanNo;

    /** 项目ID（关联project表） */
    @Excel(name = "项目ID", readConverterExp = "关=联project表")
    private Long projectId;

    /** 出借时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出借时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date loanTime;

    /** 出借物品ID（关联inventory表） */
    @Excel(name = "出借物品ID", readConverterExp = "关=联inventory表")
    private Long itemId;

    /** 出借物品数量 */
    @Excel(name = "出借物品数量")
    private Long itemQty;

    /** 出借对象 */
    @Excel(name = "出借对象")
    private Long userId;

    /** 联系方式 */
    @Excel(name = "联系方式")
    private String contact;

    /** 审批人 */
    @Excel(name = "审批人")
    private String approver;

    /** 审批意见 */
    @Excel(name = "审批意见")
    private String approveOpinion;

    /** 状态：1-已审批，2-已归还, 3-待审批 */
    @Excel(name = "状态：1-已审批，2-已归还, 3-待审批")
    private String status;

    /** 归还时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "归还时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date rerunTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("loanNo", getLoanNo())
                .append("projectId", getProjectId())
                .append("loanTime", getLoanTime())
                .append("itemId", getItemId())
                .append("itemQty", getItemQty())
                .append("userId", getUserId())
                .append("contact", getContact())
                .append("remark", getRemark())
                .append("approver", getApprover())
                .append("approveOpinion", getApproveOpinion())
                .append("status", getStatus())
                .append("rerunTime", getRerunTime())
                .toString();
    }
}